#ifndef FUNCRICHARDS_H
#define FUNCRICHARDS_H

#include "funcModel.h"

namespace QPCRModel{
class funcRichards : public funcModel{
public:
    funcRichards();

    double f(double x);
    double g(double y);

    double loss(double x, double y);
    double loss(double x, double y, const Eigen::VectorXd &X);

    double loss2(double x, double y);
    double loss2(double x, double y, const Eigen::VectorXd &X);

    double diff1(double x);
    double diff2(double x);

    Eigen::VectorXd jacobian(double x, double y);
    Eigen::VectorXd jacobian2(double x, double y);

    double curvity(double x, double norm_coef = 0);
    std::pair<double, double> getRange(int i);

public:
    void setV(const Eigen::VectorXd &v);
    Eigen::VectorXd getV();

    int getParamNum();
    double getLinearStageFunc(double *lk, double *lb);
    void init(double SPE, double EPE, int cycleNum, double ymin, double ymax) override;


public:


};

}

#endif // FUNCRICHARDS_H
